1
The Landscape of Mathematical Operators in Julia
AI015 Lesson 4
00:00

Julia’s operator landscape is designed to mirror mathematical notation, bridging the gap between formal mathematics and high-performance computing through a rich set of ASCII and Unicode symbols.

1. Arithmetic Foundations

Beyond standard binary operators, Julia provides unary forms ($+x, -x$) and specialized division. Notable features include the inverse divide ($x \backslash y$), which is equivalent to $y / x$, and the remainder operator ($x \% y$), equivalent to rem(x,y).

Arithmetic Operators
  • $+x, -x$ (Unary)
  • $x + y, x - y, x * y$
  • $x / y$ (Divide)
  • $x \div y$ (Integer Divide)
  • $x \backslash y$ (Inverse)
  • $x ^ y$ (Power)
  • $x \% y$ (Remainder)
Bitwise Operators
  • $\sim x$ (Bitwise NOT)
  • $x \& y$ (AND)
  • $x | y$ (OR)
  • $x \veebar y$ (XOR / ⊻)
  • $x >>> y$ (Logical Shift)
  • $x >> y$ (Arithmetic Shift)
  • $x << y$ (Left Shift)

2. Precision and Types

Logical negation !x is strictly for Booleans, while the tilde ($\sim$) serves as the bitwise NOT for integers. A critical nuance is type-awareness; applying $\sim$ to a UInt8 vs. a UInt32 yields different hexadecimal results because operations are performed on the specific bit-width of the underlying type.

main.py
TERMINAL bash — 80x24
> Ready. Click "Run" to execute.
>